export default {
    export2Excel(tname, theader,tbody,tdata) {
        require.ensure([], () => {
          const { export_json_to_excel } = require("@/views/basic-report/common/Export2Excel");
          //const tHeader = theader;
          let tHeader = [];
          tHeader.push(name)
          const filterVal = tbody;
          const list = tdata;
          const data = this.formatJson(filterVal, list);
          data.unshift(theader)
          data.unshift(['需求物料', '', '']);
          data.push(['','','','','','','','','','','','','','','','','','','',''])
          export_json_to_excel(tHeader, data, tname);
        });
      },
      formatJson(filterVal, jsonData) {
        return jsonData.map(v => filterVal.map(j => v[j]));
      }
}
